package com.sfc.spiderweb.serializer;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.sfc.spiderweb.eunm.AmazonViolationDataTypeEnum;

import java.io.IOException;

public class AmazonViolationDataSerialize extends JsonSerializer<String> {

    @Override
    public void serialize(String s, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
        s = AmazonViolationDataTypeEnum.getEnumValue(s);
        jsonGenerator.writeString(s);
    }
}
